<template>
  <el-checkbox-button
    :value="widget.options.value"
    :true-value="widget.options.trueValue"
    :false-value="widget.options.falseValue"
    :disabled="widget.options.disabled"
    :name="widget.options.nameString"
    :checked="widget.options.checked"
    @click.stop="selectField"
  >
    <slot></slot>
    {{ widget.options.label }}
  </el-checkbox-button>
</template>

<script setup>
import { assignmentWidget } from "@/views/pageDesign/components/globalVariable";

defineOptions({
  name: "checkboxButtonWidget",
  inheritAttrs: false,
});

let $props = defineProps({
  widget: {
    type: Object,
    required: true,
  },
});

let selectField = () => {
  assignmentWidget($props.widget);
};
</script>

<style lang="scss" scoped></style>
